package parser;

import antlr.RecognitionException;
import java.util.*;

class Global extends Expr {
    
    int name;
    
    Global(int name) {
        this.name = name;
    }
    
    void write(ByteStream out) {
        out.write(Opcodes.LOAD_GLOBAL);
        out.writeShort(name);
    }

    void delete(ByteStream out) throws RecognitionException {
        out.write(Opcodes.DELETE_GLOBAL);
        out.writeShort(name);
    }
    
    void writeLHS(ByteStream out) throws RecognitionException {
        out.write(Opcodes.STORE_GLOBAL);
        out.writeShort(name);
    }
    
}
